<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <div>
          <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="查询条件">
              <el-input v-model="formInline.user" placeholder="查询条件" clearable />
            </el-form-item>
            <el-form-item label="查询条件">
              <el-select
                  v-model="formInline.region"
                  placeholder="查询条件"
                  clearable
                  style="width: 240px"
              >
                <el-option label="Zone one" value="shanghai" />
                <el-option label="Zone two" value="beijing" />
              </el-select>
            </el-form-item>
            <el-form-item label="查询条件">
              <el-date-picker
                  v-model="formInline.date"
                  type="date"
                  placeholder="查询条件"
                  clearable
              />
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="onSubmit">查询</el-button>
            </el-form-item>
          </el-form>
        </div>
      </div>
    </template>


    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="date" label="ID" width="180"/>
      <el-table-column prop="name" label="Name" width="180"/>
      <el-table-column prop="address" label="Address"/>
      <el-table-column prop="address" label="Address"/>
      <el-table-column prop="address" label="Address"/>

      <el-table-column fixed="right" label="Operations" width="200">
        <template #default>
          <el-button type="primary" size="small">数据比对</el-button>
          <el-button type="danger" size="small" @click="handleClick">删除</el-button>
        </template>
      </el-table-column>

    </el-table>


    <template #footer>Footer content</template>
  </el-card>
</template>

<script setup>
import { reactive } from 'vue'

// do not use same name with ref
const formInline  = reactive({
  user: '',
  region: '',
  date: '',
})

const onSubmit = () => {
  console.log('submit!')
}

const handleClick = () => {
  console.log('click')
}

const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },{
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },{
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },{
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
]
</script>

<style>
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

</style>
